Repository navigation
refactor(kms-auth)!: slim DstackKms bytecode - #1569
Merged
Merged
Conversation
kvinwang
force-pushed
the
refactor/kms-contract-size
branch
from
November 12, 2026 12:59
456c0cd to
aae113a
Compare
DstackKms was 24,041 bytes against the 24,576-byte EIP-170 limit, leaving little room for new features. This takes it to 22,621 without splitting the contract: - Revert with custom errors instead of revert strings. Authorization rejection reasons, which the auth backends forward, are unchanged. - Drop the single-epoch addKmsAggregatedMrAtEpoch, addKmsDeviceAtEpoch, addOsImageHashAtEpoch and their remove counterparts; *AtEpochs(e, e, v) writes one root epoch. Manage.s.sol already used the range forms. - Pass _emitPolicy the policy hash, folded at compile time, instead of hashing a string at run time. Event values are unchanged. BREAKING CHANGE: DstackKms setters revert with custom errors. The revert strings of registerApp, setAppImplementation and deployAndRegisterApp shipped in v0.6.0; the others and the single-epoch setters are unreleased. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
force-pushed
the
refactor/kms-contract-size
branch
from
November 12, 2026 13:11
aae113a to
49b7c05
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DstackKmswas 24,041 bytes after #1567, against the 24,576-byte EIP-170 limit. This takes it to 22,621 without splitting the contract:DstackKmssetters. Authorization rejection reasons (forwarded by the auth backends) are unchanged.DstackKmssetters (add/remove{KmsAggregatedMr,KmsDevice,OsImageHash}AtEpoch); use*AtEpochs(e, e, v).Manage.s.solalready used the range forms; the two tutorials'castcommands are updated._emitPolicytakes the compile-time policy hash instead of hashing a string at run time; event values are unchanged.Breaking: the revert strings of
registerApp,setAppImplementationanddeployAndRegisterAppshipped in v0.6.0 and become custom errors (listed in the CHANGELOG); the rest is unreleased API.Tests:
forge clean && forge test --ffi(114 passed); Halmos (FOUNDRY_DYNAMIC_TEST_LINKING=false)DstackKmsSymbolicTest11/11,DstackKmsEpochSymbolicTest13/13.